<!DOCTYPE html>
<html lang="id">
<head>
	<title><?php echo PROJECT_NAME ;?></title>
	<meta charset="utf-8">
	<meta content='id' http-equiv='Content-Language'/>
	<meta content='<?php echo PROJECT_NAME ;?>' name='description'/>
	<meta content='INDEX,NOFOLLOW' name='robots'/>
	<meta content='<?php echo PROJECT_NAME ;?>' name='keywords'/>
	<meta content='1 days' name='revisit-after'/>
	<meta content='1 days' name='revisit'/>
	<link href='#' rel='shortcut icon'/>
	
	<?php
		// ASSETS //;
		echo js_asset('jquery-1.8.3.min.js','jquery-ui-bootstrap');
		echo js_asset('jquery-ui-1.9.2.custom.min.js','jquery-ui-bootstrap');
		echo js_asset('jquery.jqGrid.src.js','jquery.jqGrid-4.5.2');
		echo js_asset('jquery.fmatter.js','jquery.jqGrid-4.5.2');
		echo js_asset('bootstrap.js','bootstrap');
		echo js_asset('navbar.js');
		echo js_asset('script.js');
		
		echo css_asset('style.css');
		echo css_asset('heading.css');
		echo css_asset('color.css');
		echo css_asset('font.css');
		echo css_asset('align.css');
		echo css_asset('icon.css');
		
		echo css_asset('bootstrap.css','bootstrap');
		echo css_asset('bootstrap-responsive.min.css','bootstrap');
		echo css_asset('bootstrap-custom.css','bootstrap');
		echo css_asset('jquery-ui-1.10.0.custom.css','jquery-ui-bootstrap');
		echo css_asset('ui.jqgrid.css','jquery.jqGrid-4.5.2');
		
	?>
	<script>
	// <!-- 
		$(function(){
			/* declarisasi */
			btnLogin = $("#btn-login");
			txtUsername = $("#txt-username");
			txtPassword = $("#txt-password");
			alertLogin = $("#alert-login");
			alertInformation = $("#alert-information");
			classClose = $(".close");
			classAlert = $(".alert");
			
			gridAan = $("#grid-aan");
			gridPemasukan = $("#grid-pemasukan");
			gridKlarifikasi = $("#grid-klarifikasi");
			
			divBoxlogin = $("#div-boxlogin");
			btnBoxlogin = $("#btn-boxlogin ");
			
			btnBoxlaporan = $("#btn-boxlaporan ");
			divBoxlaporan = $("#div-boxlaporan ");
			
			/* function */
			function loadInformasi(){
				alertInformation.load('c_info',{
					task : "GET_INFO"
				});
			}
			
			/* method started */
			divBoxlogin.slideUp();
			alertLogin.hide();
			setInterval("gridAan.trigger('reloadGrid');gridPemasukan.trigger('reloadGrid');gridKlarifikasi.trigger('reloadGrid');","<?php echo ($refresh * 1000) ; ?>");
			loadInformasi();
			
			/* make component */
			gridAan.jqGrid({
				ajaxGridOptions : {type:"POST"},
				serializeGridData : function(postdata) { postdata.page = 1; return postdata; },
				url:'c_login',height: 'auto' ,
				postData : {
					task :  'LIST_AAN'
				},
				datatype: "json",
				colNames:['Nama Proyek','Tanggal'],
				colModel:[ 
					{name:'jadwal_alias',index:'jadwal_alias'},
					{name:'jadwal_tglaan',index:'jadwal_tglaan',formatter:"dateInd",align:'right'}
				],
				width:'100%',
				caption:"Jadwal Aanwijz",
				loadComplete: function(data) {
					for(i=0;i<data.length;i++){
						flag = data[i].flag;
						gridAan.children("tbody").children("tr#"+(i+1)+"").addClass(flag);
					}
				}
			}); 
			
			gridPemasukan.jqGrid({
				ajaxGridOptions : {type:"POST"},
				serializeGridData : function(postdata) { postdata.page = 1; return postdata; },
				url:'c_login',height: 'auto' ,
				postData : {
					task :  'LIST_PEMASUKAN'
				},
				datatype: "json",
				colNames:['Nama Proyek','Tanggal'],
				colModel:[ 
					{name:'jadwal_alias',index:'jadwal_alias'},
					{name:'jadwal_tglpemasukan',index:'jadwal_tglpemasukan',formatter:"dateInd",align:'right'}
				],
				width:'100%',
				caption:"Jadwal Pemasukan",
				loadComplete: function(data) {
					for(i=0;i<data.length;i++){
						flag = data[i].flag;
						gridPemasukan.children("tbody").children("tr#"+(i+1)+"").addClass(flag);
					}
				}
			}); 
			gridKlarifikasi.jqGrid({
				ajaxGridOptions : {type:"POST"},
				serializeGridData : function(postdata) { postdata.page = 1; return postdata; },
				url:'c_login',height: 'auto' ,
				postData : {
					task :  'LIST_KLARIFIKASI'
				},
				datatype: "json",
				colNames:['Nama Proyek','Tanggal'],
				colModel:[ 
					{name:'jadwal_alias',index:'jadwal_alias'},
					{name:'jadwal_tglklarifikasi',index:'jadwal_tglklarifikasi',formatter:"dateInd",align:'right'}
				],
				width:'100%',
				caption:"Jadwal Klarifikasi dan Negosiasi",
				loadComplete: function(data) {
					for(i=0;i<data.length;i++){
						flag = data[i].flag;
						gridKlarifikasi.children("tbody").children("tr#"+(i+1)+"").addClass(flag);
					}
				}
			});
			
			/* event */
			txtUsername.keypress(function(e){
				if (e.keyCode == 13){
					txtPassword.focus();
				}
			});
			txtPassword.keypress(function(e){
				if (e.keyCode == 13){
					btnLogin.click();
				}
			});
			btnLogin.click(function(){
				login_username = txtUsername.val();
				login_password = txtPassword.val();
				$.ajax({
					url		: 'c_login/process',
					type	: 'POST',
					dataType:"JSON",
					data	: {
						login_username : login_username,
						login_password : login_password,
					}
				}).done(function(response){
					if(response.message == "true"){
						window.location = "<?php echo base_url()?>"
					}else{
						alertLogin.hide();
						alertLogin.show("slow");
					}
				});
			});
			
			classClose.click(function() {
			   alertLogin.hide("slow");
			});
			
			btnBoxlogin.click(function(){
			   divBoxlogin.slideToggle("slow");
			});
			
			btnBoxlaporan.click(function(){
				left = divBoxlaporan.position().left;
				if (left == 0)
					divBoxlaporan.css("left","-220px");
				else
					divBoxlaporan.css("left","0px");
			});
			
		});
		
		flagBlink = false;
		function blinkError(){
			if (flagBlink)
				$("tr.error ").addClass("info");
			else
				$("tr.error ").removeClass("info");
				
			flagBlink = ! flagBlink;
		}
		
		setInterval("blinkError()",500);
	// -->
	</script>
	<style>
	.white{
		background : #fff !important;
	}
	tbody tr td{
		font-weight : bold !important;
		font-size : larger;
	}
	tr td:nth-child(2){
		width : 20% !important;
	}
	tr th:nth-child(2){
		width : 20% !important;
	}
	#div-info{
		float : right;
		margin-right : 10px;
	}
	</style>
</head>
<body>

<div class="header">

	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span2 center">
				<?php echo image_asset('logo.png','',array('class'=>'header-image','alt'=>PROJECT_NAME,'title'=>PROJECT_NAME)); ?>
			</div>

			<div class="span10">
			<div class="header-title color1 h4">Sistem Monitoring Tender PT. PP</div>

			</div>
		</div>
	</div>
</div>

<div class="container-fluid">

<p>&nbsp;</p>
	<div class="row-fluid">
		<div class="span12" id="main-content">
			<div id="content" >
				<div id="div-info">
						<span style="background:#f00;">&nbsp;&nbsp;&nbsp;</span> <span>Kurang dari <b><?php echo $merah; ?></b> Hari</span></br>
						<span style="background:#ff0;">&nbsp;&nbsp;&nbsp;</span> <span>Kurang dari <b><?php echo $kuning; ?></b> Hari</span></br>
						<span style="background:#0f0;">&nbsp;&nbsp;&nbsp;</span> <span>Kurang dari <b><?php echo $hijau; ?></b> Hari</span></br>
				</div>
				<div class="page-header center">
				<h3>Jadwal Tender DVO 3</h3>
				</div>
				
				
				<div class="row-fluid">
					<div class="span4" >
						<table id="grid-aan" class="table table-striped table-bordered" ></table>
						<div id="pgrid-aan"></div>
					</div>
					<div class="span4" >
						<table id="grid-pemasukan" class="table table-striped table-bordered" ></table>
						<div id="pgrid-pemasukan"></div>
					</div>
					<div class="span4" >
						<table id="grid-klarifikasi" class="table table-striped table-bordered" ></table>
						<div id="pgrid-klarifikasi"></div>
					</div>
				</div>
				<br />
				<marquee behavior="scroll"><div class="alert alert-info" id="alert-information"></div></marquee>
			</div>
		</div>
		<p>&nbsp;</p>
	</div>
</div>

<div class="navbar footer" >
	<div >
		<center>Sistem Monitoring Tender PT. PP<br /> &copy; 2013</center>
	</div>
</div>

<div id="box-login" class="slide slide-up" style="position:fixed;right:5px;top:0px;">
	<div class="span3 form">

		<div style="background:#fff;border-bottom-left-radius: 10px; padding:10px;" id="div-boxlogin">
		
		<div class="alert alert-error" id="alert-login">
		<button type="button" class="close">x</button>
		<strong>Gagal login!</strong> Mohon check username dan password anda!.
		</div>

		<input type="text" id="txt-username" placeholder="Username">
		<input type="password" id="txt-password" placeholder="Password">
		<button type="submit" class="btn btn-info" id="btn-login">Log in</button>
		</div>
		<div class="right">
		<span id=btn-boxlogin class="brand">LOG IN<span>
		</div>
	</div>
</div>

<div id="div-boxlaporan" class="slide-up" style="position:fixed;left:-220px;top:200px;transition-property : left; ">
	<div id=div-boxlaporancontent class="brand slide"  style="float:left;height:260px;width:200px">
		<ul class="nav nav-tabs nav-stacked" >
		<li><a href="c_laporan/detail/true" target="_blank">Detail Jadwal</a></li>
		<li><a href="c_laporan/pic/true" target="_blank">Jadwal Staff</a></li>
		<li><a href="c_laporan/rekap/true" target="_blank">Timeline Staff</a></li>
		<li><a href="c_laporan/printform/hasil/true" target="_blank">Hasil Tender</a></li>
		<li><a href="c_laporan/printform/masterlist/true" target="_blank">Master List</a></li>
		<li><a href="c_laporan/pq/true" target="_blank">Tender PQ</a></li>
		<li><a href="c_laporan/printform/tenderpekan/true" target="_blank">Jadwal Tender Pekan</a></li>
		</ul>
	</div><div id=btn-boxlaporan class="brand" style="float:right;height:260px;">
		L<br />
		A<br />
		P<br />
		O<br />
		R<br />
		A<br />
		N
	</div>
</div>

</body>
</html>